CMOD : Enforcing Modularity in C Code

نویسندگان

  • Saurabh Srivastava
  • Michael Hicks
چکیده

Many modern languages have sophisticated linguistic support for modular programming. In these languages, the different components of a system can be developed independently, and when combined together the resulting program will be type correct. The C programming language does not contain direct support for modules, but over time programmers have developed a discipline of modular programming which treats .c files as modules and .h header files included by C’s preprocessor cpp as interfaces. However, without proper enforcement, a mistake can easily lead to a confusing error and time wasted tracking it down. This paper presents CMOD, a tool that enforces rules to ensure that common idioms for modularity are used correctly, and thus the program is compiled correctly. CMOD easily fits within the development process as a front-end for the compiler and linker (e.g., gcc and ld). We have tested CMOD on a number of open source software systems and found that each exhibits a small number of violations of our rules, all of which can be easily fixed.

برای دانلود متن کامل این مقاله و بیش از 32 میلیون مقاله دیگر ابتدا ثبت نام کنید

ثبت نام

اگر عضو سایت هستید لطفا وارد حساب کاربری خود شوید

منابع مشابه

Cmod: Modular Information Hiding and Type-Safe Linking for C∗

This paper presents Cmod, a novel tool that provides a sound module system for C. Cmod works by enforcing a set of four rules that are based on principles of modular reasoning and on current programming practice. Cmod’s rules flesh out the convention that .h header files are module interfaces and .c source files are module implementations. Although this convention is well-known, developing Cmod...

متن کامل

Mining Overlapping Communities in Real-world Networks Based on Extended Modularity Gain

Detecting communities plays a vital role in studying group level patterns of a social network and it can be helpful in developing several recommendation systems such as movie recommendation, book recommendation, friend recommendation and so on. Most of the community detection algorithms can detect disjoint communities only, but in the real time scenario, a node can be a member of more than one ...

متن کامل

WAMCC: Compiling Prolog to C

We present the wamcc system, a Prolog compiler that translates Prolog to C via the WAM. This approach has some interesting consequences: simplicity, efficiency, portability, extensibility and modularity. Indeed the system does not incorporate complex optimizations but is as efficient as Quintus Prolog 2.5 (based on an emulator written in assembly language) and only 30 % slower than Sicstus Prol...

متن کامل

Hardware Works, Software Doesn't: Enforcing Modularity with Mondriaan Memory Protection

Two big problems with operating systems written in unsafe languages are that they crash too often and that adding features becomes much more difficult over time. One cause of both of these problems is the lack of enforceable memory protection between module boundaries. Clear module boundaries make dependencies explicit, resulting in more reliable and maintainable code. Mondriaan Memory Protecti...

متن کامل

DISSCO: A Unified Approach to Sound Synthesis and Composition

DISSCO (Digital Instrument for Sound Synthesis and Composition) represents a unified and comprehensive approach to sound synthesis and composition—unified in the sense that its components share a common formal approach and use similar tools, comprehensive in the sense that they deliver a final product (a musical “event”) that does not require further processing. DISSCO consists of two parts: LA...

متن کامل

ذخیره در منابع من


  با ذخیره ی این منبع در منابع من، دسترسی به آن را برای استفاده های بعدی آسان تر کنید

برای دانلود متن کامل این مقاله و بیش از 32 میلیون مقاله دیگر ابتدا ثبت نام کنید

ثبت نام

اگر عضو سایت هستید لطفا وارد حساب کاربری خود شوید

عنوان ژورنال:

دوره   شماره 

صفحات  -

تاریخ انتشار 2006